package com.yanqu.road.server.manger.union.listener;

import com.yanqu.road.entity.enums.eUnionSyncType;
import com.yanqu.road.entity.union.cross.CrossUnionInfo;
import com.yanqu.road.entity.union.cross.CrossUnionMember;
import com.yanqu.road.server.GameServer;
import com.yanqu.road.server.manger.ICrossUnionSyncListener;
import com.yanqu.road.server.manger.ServerConfigMgr;
import com.yanqu.road.server.manger.activity.tonbing.TonBingMgr;
import com.yanqu.road.server.manger.activity.tonbingchannel.ChannelTonBingMgr;
import com.yanqu.road.server.manger.union.CrossUnionMgr;

import java.util.List;
import java.util.Map;

/**
 * 癫疯统兵活动监听
 */
public class TonBingListener implements ICrossUnionSyncListener {

    @Override
    public void notifySync(int syncType, long playerId, CrossUnionInfo unionInfo, List<CrossUnionMember> memberList) {
        if(unionInfo.getServerId() == GameServer.getInstance().getServerId()){
            if(syncType == eUnionSyncType.FlagChange.getValue()){
                if(playerId == unionInfo.getMasterUserId()){
                    TonBingMgr.unionChange(unionInfo.getUnionUid());
                    ChannelTonBingMgr.unionChange(unionInfo.getUnionUid());
                }
            }
        }
    }
}
